Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise/coordtransforms #29

Merged
merged 4 commits into from
Jun 13, 2024
Merged

Optimise/coordtransforms #29

merged 4 commits into from
Jun 13, 2024

Conversation

Waqar-ukaea
Copy link
Collaborator

@Waqar-ukaea Waqar-ukaea commented Jun 13, 2024

Short PR focused on optimisations I have made after reviewing the results from profiling with Intel VTune hotspots analysis which provides some metrics for hot functions/paths within the code.

Changelist

  • Created a new function inline CoordTransform::cart_to_polar_xy() which handles conversion to polar coordinates returning only (R,Z) as the calculation of the angle phi relies on the expensive atan2 function. Existing full cart_to_polar() function which returns (R,Z,PHI) still exists and is used in some places where the angle phi is required such as Cartesian b-field calculation
  • New function inline CoordTransform::cart_to_polar_phi() to only return phi and not (R,Z)
  • Changed a lot of older functions that passed by value to now pass by const reference instead
  • Added a new function EquilData::get_psi(R,Z) to get the value of psi at a particular polar coordinate (R,Z) instead of having to do a full polar_to_flux transformation as was done previously
  • Cleaned up function definitions under CoordTransform namespace
  • Cleaned up various other functions to not waste time declaring 'std::vectors' when they don't need to in an attempt to speedup new and free times which were identified as a top hotspot in VTune analysis

@Waqar-ukaea Waqar-ukaea merged commit a661ee2 into main Jun 13, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant